using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Box2D.XNA;
namespace TurbaconPhone
{
    public class TurbaconContactListener : IContactListener
    {
        public void BeginContact(Contact contact) { }
        public void EndContact(Contact contact) { }
        public void PreSolve(Contact contact, ref Manifold oldManifold) { }
        public void PostSolve(Contact contact, ref ContactImpulse impulse) 
        {
            KineticGameObject[] obj=new KineticGameObject[2];
            obj[0] = (KineticGameObject)contact.GetFixtureA().GetBody().GetUserData();
            obj[1] = (KineticGameObject)contact.GetFixtureB().GetBody().GetUserData();
            for (int i = 0; i < 2; i++)
                if(obj[i]!=null&&!obj[i].bDead)
                    obj[i].Bump(obj[1 - i]);
        }
    }
}
